package wheres.the.party;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener{
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        //initButtons();
    }

    @Override
    protected void onStart() {
        super.onStart();
        // The activity is about to become visible.
    }
    @Override
    protected void onResume() {
        super.onResume();
        // The activity has become visible (it is now "resumed").
        updateLocale();
    }
    @Override
    protected void onPause() {
        super.onPause();
        // Another activity is taking focus (this activity is about to be "paused").
    }
    @Override
    protected void onStop() {
        super.onStop();
        // The activity is no longer visible (it is now "stopped")
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        // The activity is about to be destroyed.
    }
    
    public void initButtons(){
    	 Button startTrack = (Button)(findViewById(R.id.startParty));
         startTrack.setOnClickListener(this);
         
    	 Button seeTrack = (Button)(findViewById(R.id.findParty));
         seeTrack.setOnClickListener(this);
         
    	 Button settings = (Button)(findViewById(R.id.settings));
         settings.setOnClickListener(this);
         
    	 Button help = (Button)(findViewById(R.id.help));
         help.setOnClickListener(this);
         
    	 Button about = (Button)(findViewById(R.id.about));
         about.setOnClickListener(this);
    }
    
    /*
	 * Update all button-texts and so on, with the proper language
	 */
	public void updateLocale(){
		TextView header = ((TextView)(findViewById(R.id.header)));
		header.setText(getString(R.string.whereIsTheParty));

		TextView choose = ((TextView)(findViewById(R.id.choose)));
		choose.setText(getString(R.string.choose));
		
		Button startTrack = ((Button)(findViewById(R.id.startParty)));
		startTrack.setText(getString(R.string.startParty));

		Button seeTrack = ((Button)(findViewById(R.id.findParty)));
		seeTrack.setText(getString(R.string.findParty));
		
		Button settings = ((Button)(findViewById(R.id.settings)));
		settings.setText(getString(R.string.settings));

		Button help = ((Button)(findViewById(R.id.help)));
		help.setText(getString(R.string.help));

		Button about = ((Button)(findViewById(R.id.about)));
		about.setText(getString(R.string.about));
	}
    
	@Override
	public void onClick(View view){
		/*switch(view.getId()){
			case R.id.startTrack:
				startActivity(new Intent(MainActivity.this, TrackerActivity.class));
				break;
			case R.id.seeTracks:
				startActivity(new Intent(MainActivity.this, ListTracksActivity.class));
				break;
			case R.id.settings:
				startActivity(new Intent(MainActivity.this, SettingsActivity.class));
				break;
			case R.id.help:
				startActivity(new Intent(MainActivity.this, HelpActivity.class));
				break;
			case R.id.about:
				startActivity(new Intent(MainActivity.this, AboutActivity.class));
				break;
		}*/
	}
}